﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "IParameterValueStorage.h"
#include "Coordinate3d.h"
#include "PointTypes.h"

namespace gcmp
{
    class ICurve3d;
    class ICurve2d;
    class IPolyCurve;
    class IPolygon;
    class IGraphicsCurve3d;

    /// \brief 点成线参数接口类
    class GCMP_MODEL_INTERFACE_EXPORT IParameterValueCurveByPoints : public IParameterValueStorage
    {
    public:
        DEFINE_CAST_DERIVED(gcmp::IParameterValueCurveByPoints, gcmp::IParameterValueStorage)

    public:
        /// \brief 创建一个默认点的点成线参数值存储对象
        ///
        /// \return 参数值存储对象
        static OwnerPtr<IParameterValueCurveByPoints> Create();

        /// \brief 获取坐标系数组类型参数值
        ///
        /// \return 坐标系数组类型参数值
        virtual const std::vector<Coordinate3d>& GetValue() const = 0;

        /// \brief 设置坐标系数据
        /// \param pCurve - 定位线，目前支持IGraphicsLine、IGraphicsArc、IGraphicsEllipse类型
        /// \return 如果设置成功返回true，否则返回false
        virtual bool SetCoordinateSystemsByCurve3d(const ICurve3d* pCurve) = 0;

        /// \brief 设置坐标系数据
        /// \param pCurve - 2维线，目前支持ILine2d、IArc2d、IEllipse2d类型
        /// \return 如果设置成功返回true，否则返回false
        virtual bool SetCoordinateSystemsByCurve2d(const ICurve2d* pCurve) = 0;

        /// \brief 设置坐标系数据
        /// \param pCurves - 2维线数组，目前支持ILine2d、IArc2d、IEllipse2d类型
        /// \return 如果设置成功返回true，否则返回false
        virtual bool SetCoordinateSystemsByCurve2ds(const std::vector<ICurve2d*> &pCurves) = 0;

        /// \brief 设置坐标系数据
        /// \param pPolyCurve - 2维多段线，
        /// \return 如果设置成功返回true，否则返回false
        virtual bool SetCoordinateSystemsByPolyCurve(const IPolyCurve* pPolyCurve) = 0;

        /// \brief 获得点类型
        ///
        /// \return 点类型数组
        virtual std::vector<PointTypes> GetPointTypes() const = 0;

        /// \brief 根据点类型生成曲线
        ///
        /// \return 三维曲线集合
        virtual std::vector<OwnerPtr<IGraphicsCurve3d>> GenerateCurve() const = 0;

        /// \brief 设置坐标系数据
        /// \param pPolygon 多边形
        /// \return 设置成功返回true，设置失败返回false
        virtual bool SetCoordinateSystemsByPolygon(const IPolygon* pPolygon) = 0;
    };
}


